<?php
class block_rights_1 extends Update_Model_Database_AbstractChange{

	protected $comment="Создание таблицы block_rights";

	public function up(){
		$sql=
			'CREATE TABLE IF NOT EXISTS block_rights(
	  			id INT(11) NOT NULL AUTO_INCREMENT,
	  			block_id INT(11) NOT NULL,
	  			url TEXT NOT NULL,
	  			allow TINYINT(1) NOT NULL DEFAULT 1,
	  			PRIMARY KEY (id)
			)
				ENGINE = INNODB
				CHARACTER SET utf8
				COLLATE utf8_general_ci;';
		$this->db->query($sql);
	}

	public function down(){
		$sql='DROP TABLE IF EXISTS block_rights;';
		$this->db->query($sql);
	}

}